﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlDangKyTuVanVienChinhThuc.ascx.cs" Inherits="WebUserControl_ControlDangKyTuVanVien" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register src="uscMsgBox.ascx" tagname="uscMsgBox" tagprefix="uc2" %>
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/datePicker.css")%>' type="text/css" />
<script type="text/javascript"  src='<%=ResolveUrl("~/JScript/jquery.alphanumeric.js")%>'></script>
<link rel="stylesheet" href='<%=ResolveUrl("~/LayoutCss/K_BaoCaoFormLayout.css")%>' type="text/css" />

<script type="text/javascript">
     function pageLoad() {
     $("#<%= txtDtCoDinh.ClientID %>").numeric();
     $("#<%= txtDTDiDong.ClientID %>").numeric();
     $("#<%= txtSoCMND.ClientID %>").numeric();
      $(function()
     {
	    $("#<%= txtNgayGiaNhap.ClientID %>").datePicker(
		{
			clickInput:true,
			startDate: new Date().asString()
		}
	);
});

 $(function()
     {
	    $("#<%= txtNgaySinh.ClientID %>").datePicker(
		{
			clickInput:true,
			startDate: '01/01/1950',
			endDate: (new Date).getDate() + '/' + (new Date).getMonth() + '/' + ((new Date).getFullYear() - 18) 
		}
	);
});



      $("#<%= ImgNew.ClientID %>").click(function() { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }); 
        
       $("#<%= ImgSave.ClientID %>").click(function() { 
         if ($("#<%= txtMaTuVanVien.ClientID %>").val().length>0 && $("#<%= txtTenTuVanVien.ClientID %>").val().length>0 && $("#<%= txtNgaySinh.ClientID %>").val().length>0 && $("#<%= txtRootAddress.ClientID %>").val().length>0 && $("#<%= txtSoCMND.ClientID %>").val().length>0 && $("#<%= txtNgayGiaNhap.ClientID %>").val().length>0 && $("#<%= txtMaNguoiGioiThieu.ClientID %>").val().length>0 && $("#<%= txtSoNha.ClientID %>").val().length>0 && $("#<%= txtTenDuong.ClientID %>").val().length>0)
        {
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } });
        } 
        }); 
        
        
          $("#<%= ImageButton2.ClientID %>").click(function() {
           if ($("#<%= txtMaTuVanVien.ClientID %>").val().length>0)
        { 
        $.blockUI({
             message: '<h1>Xin vui lòng chờ xử lý</h1>', 
            css: { 
            border: 'none', 
            padding: '15px', 
            backgroundColor: '#f00', 
            opacity: .5, 
            color: '#fff' 
        } }); 
        }
        });  
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                function EndRequestHandler(sender, args) {
                        $.unblockUI();
                }
        }  
   
</script> 
<style type="text/css">
        .AutoExtender
        {
            font-family: Verdana, Helvetica, sans-serif;
            font-size: .8em;
            font-weight: normal;
            border: solid 1px #006699;
            line-height: 20px;
            padding: 10px;
            background-color: White;
            margin-left:10px;
        }
        .AutoExtenderList
        {
            border-bottom: dotted 1px #006699;
            cursor: pointer;
            color: Maroon;
        }
        .AutoExtenderHighlight
        {
            color: White;
            background-color: #006699;
            cursor: pointer;
        }
        #divwidth
        {
          width: auto !important;    
        }
        #divwidth div
       {
        width: auto !important;   
       }
 </style>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <fieldset>
    <legend>Đăng ký TVV chính thức</legend>
    </fieldset>
         <asp:Panel ID="Panel1" runat="server" BackColor="#EBEBEB" 
                        BorderStyle="None" Height="33px" Width="100%">
                        <asp:ImageButton ID="ImgNew" runat="server" CausesValidation="False" 
                            Height="25px" ImageUrl="~/image/New File.png" OnClick="ImgNew_Click" 
                            ToolTip="Tạo mới" Width="25px" />
                        &nbsp;<asp:ImageButton ID="ImgSave" runat="server" Height="25px" 
                            ImageUrl="~/image/floppy disk.png" OnClick="ImgSave_Click" 
                            ToolTip="Cập nhật" Width="25px"/>
                        &nbsp;<asp:ImageButton ID="ImageButton2" Enabled="false" runat="server" Height="25px" 
                            ImageUrl="~/image/Symbol-Delete.png" Width="25px" ToolTip="Xóa" onclick="ImageButton2_Click" />
                        &nbsp;<asp:ImageButton ToolTip="Tìm kiếm" ID="ImgTimKiemTuVanVienChinhThuc" runat="server" 
                            Height="25px" Width="25px" CausesValidation="false" ImageUrl="~/image/Find.png" 
                            onclick="ImgTimKiemTuVanVienChinhThuc_Click" />
                    </asp:Panel>
        <br />
        
        <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            BackColor="#CCFFFF" Font-Names="Arial"  Height="720px" 
            Width="906px">
            <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Nhập thông tin" TabIndex="0">
                <ContentTemplate>
                   <fieldset>
                    <legend>Thông tin cá nhân</legend>
                    <div class="fm-req">
                       <label for="txtMaTuVanVien">Mã BA:</label>
                       <asp:TextBox ID="txtMaTuVanVien" BackColor="Yellow" runat="server" ReadOnly="True" Width="150px"></asp:TextBox>
                   </div>
                    <div class="fm-req">
                       <label for="txtTenTuVanVien">Họ tên:</label>
                       <asp:TextBox ID="txtTenTuVanVien" runat="server" Width="200px" MaxLength="30" TabIndex="1"></asp:TextBox>
                        <asp:RequiredFieldValidator ControlToValidate="txtTenTuVanVien" Display="None"  ID="RequiredFieldValidator1" runat="server" ErrorMessage="Phải nhập tên tư vấn viên">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator1" ID="ValidatorCalloutExtender1" runat="server">
                                </cc1:ValidatorCalloutExtender>
                   </div>
                    <div class="fm-req">
                       <label for="DropNoiCap">Ngày sinh:</label>
                        <asp:TextBox ID="txtNgaySinh" runat="server" Width="120px"  TabIndex="2"></asp:TextBox>
                        <asp:RequiredFieldValidator ControlToValidate="txtNgaySinh" Display="None"  ID="RequiredFieldValidator2" runat="server" ErrorMessage="Phải nhập ngày sinh">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator2" ID="ValidatorCalloutExtender2" runat="server">
                                </cc1:ValidatorCalloutExtender>
                   </div> 
                    <div class="fm-req"> 
                      <label for="CheckGioiTinh">Giới tính(Nam):</label>
                     <asp:CheckBox ID="CheckGioiTinh" runat="server"/>
                    </div> 
                    <div class="fm-req">
                    <label for="txtNgheNghiep">Địa chỉ thường  trú:</label> 
                     <asp:TextBox ID="txtRootAddress" runat="server" TabIndex="3" Width="200px"></asp:TextBox>
                     <asp:RequiredFieldValidator ControlToValidate="txtRootAddress" Display="None"  ID="RequiredFieldValidator3" runat="server" ErrorMessage="Phải nhập địa chỉ thường trú">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator3" ID="ValidatorCalloutExtender3" runat="server">
                                </cc1:ValidatorCalloutExtender>
                    </div>
                    <div class="fm-req">
                       <label for="txtSoCMND">Số CMND:</label>
                       <asp:TextBox ID="txtSoCMND" runat="server" Width="200px" TabIndex="4"></asp:TextBox>
                       
                                <asp:RegularExpressionValidator ID="regexpName" runat="server"     
                                    ErrorMessage="Bắt buột phải 9 ký tự số"  Display="None"
                                    ControlToValidate="txtSoCMND"   ValidationExpression="^[0-9]{9,9}$" />
                                 <cc1:ValidatorCalloutExtender TargetControlID="regexpName" ID="ValidatorCalloutExtender9" runat="server">
                                </cc1:ValidatorCalloutExtender>
                                    
                   </div>
                    <div class="fm-req">
                       <label for="DropNoiCap">Nơi cấp:</label>
                       <asp:DropDownList ID="DropNoiCap" runat="server" TabIndex="5">
                       </asp:DropDownList>
                   </div>
                    <div class="fm-req">
                       <label for="DropNoiCap">Trình độ:</label>
                       <asp:DropDownList ID="DropTrinhDo" runat="server" TabIndex="6">
                       </asp:DropDownList>
                   </div>
                    <div class="fm-re">
                        <label for="txtNgheNghiep">Nghề nghiệp:</label> 
                            <asp:TextBox ID="txtNgheNghiep" runat="server" TabIndex="7" Width="250px"></asp:TextBox>
                            
                    </div>  
                 </fieldset>
                   <fieldset>
                   <legend>Thông tin làm việc</legend>
                     <div class="fm-req">
                       <label for="DropNoiCap">Ngày gia nhập:</label>
                        <asp:TextBox ID="txtNgayGiaNhap" runat="server" Width="120px"  TabIndex="8"></asp:TextBox>
                        <asp:RequiredFieldValidator ControlToValidate="txtNgayGiaNhap" Display="None"  ID="RequiredFieldValidator5" runat="server" ErrorMessage="Phải nhập ngày gia nhập">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator5" ID="ValidatorCalloutExtender5" runat="server">
                                </cc1:ValidatorCalloutExtender>   
                   </div> 
                     <div class="fm-req">
                       <label for="CheckConBanHang">Còn bán hàng :</label>
                    <asp:CheckBox ID="CheckConBanHang" Enabled="false" runat="server" Checked="True" />
                    </div>
                     <div class="fm-req">
                       <label for="DropNoiCap">Danh hiệu hiện tại:</label>
                       <asp:DropDownList Enabled="false" ID="DropDH" runat="server" TabIndex="9">
                       </asp:DropDownList>
                   </div> 
                     <div class="fm-req">
                    <label for="CheckFullTime">Toàn thời gian:</label>  
                        <asp:CheckBox ID="CheckFullTime" Checked="True" runat="server" />
                    </div> 
                     <div class="fm-req">
                       <label for="txtMaNguoiGioiThieu">Mã người bảo trợ:</label>
                        <asp:TextBox ID="txtMaNguoiGioiThieu" CausesValidation="false" AutoPostBack="true" BackColor="Yellow" ReadOnly="true" ontextchanged="txtMaNguoiGioiThieu_TextChanged" runat="server" TabIndex="10" Width="150px">
                        </asp:TextBox>
                         <asp:RequiredFieldValidator ControlToValidate="txtMaNguoiGioiThieu" Display="None"  ID="RequiredFieldValidator6" runat="server" ErrorMessage="Phải nhập mã người bảo trợ">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator6" ID="ValidatorCalloutExtender6" runat="server">
                                </cc1:ValidatorCalloutExtender>   
                        <div id="divwidth" style="overflow:scroll; height:150px;display:none"></div>
            <cc1:AutoCompleteExtender CompletionSetCount="12"
            CompletionInterval="10" 
            MinimumPrefixLength="1" 
            ServiceMethod="GetTuVanVienInfo"
            TargetControlID="txtMaNguoiGioiThieu"
            ServicePath="~/Services/WebServiceNhapHoaDonBanHang.asmx"
            ID="AutoCompleteExtender1" 
            runat="server" CompletionListItemCssClass="AutoExtenderList"
             DelimiterCharacters="" Enabled="True" 
             CompletionListHighlightedItemCssClass="AutoExtenderHighlight"
             CompletionListElementID="divwidth" 
            CompletionListCssClass="AutoExtender">
            </cc1:AutoCompleteExtender>
                        <asp:TextBox ID="txtTenNguoiGioiThieu" ReadOnly="true" BackColor="Yellow" runat="server"  Width="200px"></asp:TextBox>
                   </div>
                   </fieldset>
                   <fieldset>
                        <legend>Thông tin liên lạc</legend>
                    <div class="fm-req">
                    <label for="txtNgheNghiep">Số nhà:</label> 
                    <asp:TextBox ID="txtSoNha" runat="server" TabIndex="11" Width="250px"></asp:TextBox>
                    <asp:RequiredFieldValidator ControlToValidate="txtSoNha" Display="None"  ID="RequiredFieldValidator7" runat="server" ErrorMessage="Phải nhập số nhà">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator7" ID="ValidatorCalloutExtender7" runat="server">
                                </cc1:ValidatorCalloutExtender>  
                    </div>
                    <div class="fm-req">
                    <label for="txtTenDuong">Đường:</label> 
                    <asp:TextBox ID="txtTenDuong" runat="server" TabIndex="12" Width="250px"></asp:TextBox>
                     <asp:RequiredFieldValidator ControlToValidate="txtTenDuong" Display="None"  ID="RequiredFieldValidator8" runat="server" ErrorMessage="Phải nhập tên đường">
                                </asp:RequiredFieldValidator>
                                <cc1:ValidatorCalloutExtender TargetControlID="RequiredFieldValidator8" ID="ValidatorCalloutExtender8" runat="server">
                                </cc1:ValidatorCalloutExtender> 
                    </div>
                    <div class="fm-req">
                    <label for="DropTinh">Tỉnh/Thành:</label> 
                    <asp:DropDownList ID="DropTinh" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropTinh_SelectedIndexChanged1" 
                                    TabIndex="13" Width="130px">
                                </asp:DropDownList>
                     
                    </div>  
                     <div class="fm-req">
                      <label for="DropTinh">Quận/Huyện:</label> 
                    <asp:DropDownList ID="DropQuanHuyen" runat="server" TabIndex="14" Width="130px">
                                </asp:DropDownList>
                     </div>
                     <div class="fm-re">
                    <label for="txtNgheNghiep">Điện thoại bàn:</label> 
                     <asp:TextBox ID="txtDtCoDinh" runat="server" TabIndex="16" Width="200px"></asp:TextBox>
                    </div>
                     <div class="fm-re">
                    <label for="txtNgheNghiep">Di động:</label> 
                     <asp:TextBox ID="txtDTDiDong" runat="server" TabIndex="17" Width="200px"></asp:TextBox>
                    </div>
                   </fieldset>     
                </ContentTemplate>
            </cc1:TabPanel>
            
            <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Tìm kiếm" TabIndex="1">
                <ContentTemplate>
                <fieldset>
                    <legend>Tìm kiếm TVV</legend>
    
                    <div class="fm-req">
                    <label for="txtNgheNghiep">Nhập thông tin cần tìm:</label> 
                        <asp:TextBox ID="txtSearch" runat="server" AutoPostBack="True" OnTextChanged="txtSearch_TextChanged" CausesValidation="false" Width="168px"></asp:TextBox>
                        <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" Height="20px" ImageUrl="~/image/Search.png" OnClick="ImageButton1_Click" Width="20px" /> 
                   </div> 
                          <br />     
                                <asp:GridView ID="GridView2" runat="server" AllowPaging="True" 
                                    AutoGenerateColumns="False" BackColor="#DEBA84" BorderColor="#DEBA84" 
                                    BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" 
                                    DataKeyNames="salesp_key"  onpageindexchanging="GridView2_PageIndexChanging"  
                                    OnRowCommand="GridView2_RowCommand" PageSize="5" Width="306px">
                                    <Columns>
                                        <asp:BoundField DataField="salesp_key" HeaderText="Mã" />
                                        <asp:BoundField DataField="salesp_name" HeaderText="Họ tên" />
                                        <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:Button ID="Button2" runat="server" CausesValidation="false" Width="100px" 
                                                    CommandName="chon" Text="Chọn" />
                                            </ItemTemplate>
                                            <FooterStyle BackColor="White" BorderColor="White" />
                                            <HeaderStyle BackColor="White" BorderColor="White" />
                                            <ItemStyle BackColor="White" BorderColor="White" />
                                        </asp:TemplateField>
                                    </Columns>
                                    <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
                                    <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
                                    <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
                                </asp:GridView>  
                  </fieldset>   
                </ContentTemplate>
            </cc1:TabPanel>
        </cc1:TabContainer> 
          
</ContentTemplate>
</asp:UpdatePanel> 
 <uc2:uscMsgBox ID="uscMsgBox1" runat="server" />

 

 